package com.timu;

import java.util.Date;
import java.util.Random;

public class UserCodeUtil {

    public static String getUserCode() {
        StringBuffer sb =
                new StringBuffer(
                        String.valueOf(System.currentTimeMillis())
                );
        Random random = new Random();
        int count = 30 - sb.length();
        // 要确定补多少个数字
        for (int i = 0; i < count; i++) {
            sb.append(random.nextInt(10));
        }
        return sb.toString();
    }
    public static void main(String[] args) {
        System.out.println(getUserCode().length()); // 30
    }
}
